package com.eugene.scheduler;

import android.graphics.Color;

/**
 * Created by HOME on 04.01.14.
 */
public class ColorProvider {

    public enum Style{
        Glass (0),
        Transparent (1),
        OnePiece (2),
        Green (3),
        Notebook (4);

        private final int value;
        private Style(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

    }

    public enum Resource{
        MainWidget,
        Cell,
        LineH,
        LineV
    }

    public enum Position{
        TextDay,
        TextHoliday,
        TextDayTM,
        TextHolidayTM,
        TextToday,
        TextHeader,
        BackDay,
        BackHoliday,
        BackDayTM,
        BackHolidayTM,
        BackToday,
        BackHeader,
        Background
    }


    static public Style style = Style.Notebook;

    static void setStyle(Style s){
        style = s;
    }

    static String getStyleName(Style s){
        return getStyleName(s.ordinal());
    }

    static String getStyleName(int s){
            switch(s){
            case 0: return "Glass";
            case 1: return "OnePiece";
            case 2: return "Green";
            case 3: return "Transparent";
            case 4: return "Notebook";
            default: return "";
        }
    }

    static String[] getWeekDays(){
        String[] middle = {"","Пн","Вт","Ср","Чт","Пт","Сб","Вс"};
        String[] small = {"","пн","вт","ср","чт","пт","сб","вс"};
        String[] huge = {"","ПН","ВТ","СР","ЧТ","ПТ","СБ","ВС"};
        if(style == Style.Green || style == Style.Notebook) return small;
        if(style == Style.Transparent) return huge;
        return middle;
    }

    int getResourse(Resource res){
        switch(style){
            case Glass:
                switch(res){
                    case MainWidget: return R.layout.widget;
                    case LineH:      return R.layout.line_h;
                    case LineV:      return R.layout.line_v;
                    case Cell:       return R.layout.cell_day;
                }

            case OnePiece:
                switch(res){
                    case MainWidget: return R.layout.widget_2;
                    case LineH:      return R.layout.line_h;
                    case LineV:      return R.layout.line_v;
                    case Cell:       return R.layout.cell_day;
                }

            case Green:
                switch(res){
                    case MainWidget: return R.layout.widget_3;
                    case LineH:      return R.layout.line_h;
                    case LineV:      return R.layout.line_v;
                    case Cell:       return R.layout.cell_day_bold;
                }

            case Transparent:
                switch(res){
                    case MainWidget: return R.layout.widget_4;
                    case LineH:      return R.layout.empty;
                    case LineV:      return R.layout.empty;
                    case Cell:       return R.layout.cell_day;
                }

            case Notebook:
                switch(res){
                    case MainWidget: return R.layout.widget_5;
                    case LineH:      return R.layout.line_h;
                    case LineV:      return R.layout.line_v;
                    case Cell:       return R.layout.cell_day;
                }
        }
        return 0;
    }

    int getColor(Position pos){
        switch(style){
            case Glass:
                switch(pos){
                    case TextDay:       return R.color.TextDay_Glass;
                    case TextHoliday:   return R.color.TextHoliday_Glass;
                    case TextDayTM:     return R.color.TextDayTM_Glass;
                    case TextHolidayTM: return R.color.TextHolidayTM_Glass;
                    case TextToday:     return R.color.TextToday_Glass;
                    case TextHeader:    return R.color.TextHeader_Glass;
                    case BackDay:       return R.color.BackDay_Glass;
                    case BackHoliday:   return R.color.BackHoliday_Glass;
                    case BackDayTM:     return R.color.BackDayTM_Glass;
                    case BackHolidayTM: return R.color.BackHolidayTM_Glass;
                    case BackToday:     return R.drawable.back;
                    case BackHeader:    return R.drawable.middle;
                    case Background:    return R.color.Background_Glass;
                }

            case OnePiece:
                switch(pos){
                    case TextDay:       return R.color.TextDay_OnePiece;
                    case TextHoliday:   return R.color.TextHoliday_OnePiece;
                    case TextDayTM:     return R.color.TextDayTM_OnePiece;
                    case TextHolidayTM: return R.color.TextHolidayTM_OnePiece;
                    case TextToday:     return R.color.TextToday_OnePiece;
                    case TextHeader:    return R.color.TextHeader_OnePiece;
                    case BackDay:       return R.color.BackDay_OnePiece;
                    case BackHoliday:   return R.color.BackHoliday_OnePiece;
                    case BackDayTM:     return R.color.BackDayTM_OnePiece;
                    case BackHolidayTM: return R.color.BackHolidayTM_OnePiece;
                    case BackToday:     return R.drawable.back;
                    case BackHeader:    return R.color.transparent;
                    case Background:    return R.color.transparent;
                }

            case Green:
                switch(pos){
                    case TextDay:       return R.color.TextDay_Green;
                    case TextHoliday:   return R.color.TextHoliday_Green;
                    case TextDayTM:     return R.color.TextDayTM_Green;
                    case TextHolidayTM: return R.color.TextHolidayTM_Green;
                    case TextToday:     return R.color.TextToday_Green;
                    case TextHeader:    return R.color.TextHeader_Green;
                    case BackDay:       return R.color.BackDay_Green;
                    case BackHoliday:   return R.color.BackHoliday_Green;
                    case BackDayTM:     return R.color.BackDayTM_Green;
                    case BackHolidayTM: return R.color.BackHolidayTM_Green;
                    case BackToday:     return R.color.BackToday_Green;
                    case BackHeader:    return R.color.BackHeader_Green;
                    case Background:    return R.color.Background_Green;
                }

            case Transparent:
                switch(pos){
                    case TextDay:       return R.color.TextDay_Transparent;
                    case TextHoliday:   return R.color.TextHoliday_Transparent;
                    case TextDayTM:     return R.color.TextDayTM_Transparent;
                    case TextHolidayTM: return R.color.TextHolidayTM_Transparent;
                    case TextToday:     return R.color.TextToday_Transparent;
                    case TextHeader:    return R.color.TextHeader_Transparent;
                    case BackDay:       return R.color.BackDay_Transparent;
                    case BackHoliday:   return R.color.BackHoliday_Transparent;
                    case BackDayTM:     return R.color.BackDayTM_Transparent;
                    case BackHolidayTM: return R.color.BackHolidayTM_Transparent;
                    case BackToday:     return R.color.BackToday_Transparent;
                    case BackHeader:    return R.color.BackHeader_Transparent;
                    case Background:    return R.color.Background_Transparent;
                }

            case Notebook:
                switch(pos){
                    case TextDay:       return R.color.TextDay_Notebook;
                    case TextHoliday:   return R.color.TextHoliday_Notebook;
                    case TextDayTM:     return R.color.TextDayTM_Notebook;
                    case TextHolidayTM: return R.color.TextHolidayTM_Notebook;
                    case TextToday:     return R.color.TextToday_Notebook;
                    case TextHeader:    return R.color.TextHeader_Notebook;
                    case BackDay:       return R.color.BackDay_Notebook;
                    case BackHoliday:   return R.color.BackHoliday_Notebook;
                    case BackDayTM:     return R.color.BackDayTM_Notebook;
                    case BackHolidayTM: return R.color.BackHolidayTM_Notebook;
                    case BackToday:     return R.drawable.notepad_back;
                    case BackHeader:    return R.drawable.notepad_header2;
                    case Background:    return R.color.Background_Notebook;
                }
        }
        return 0;
    }

}
